<template>
	<view class="centent">
 <cropper ref="cropper" :aspectRatio="null" @complete="complete" @cancel="cancel" :width="width" :height="height" initialBoxWidthRatio="1" initialBoxHeightRatio="1" ></cropper>
	</view>
</template>

<script>
import Cropper from '../components/yankai-cropper/cropper.vue';
	export default {
		components: {
		    Cropper
		},
		data() {
			return {
				show:false,
				url:'',
				back_img:'',
				width:200,//裁剪宽度
				height:200,//裁剪高度
			};
		},
		onLoad(options){
			this.url=options.img_url;
			this.cai()
		},
		methods:{
			cai(){
				this.$refs.cropper.init(this.url);
			},
			cancel(){
				uni.navigateBack()
			},
			complete(obj){
				uni.redirectTo({
					url:`/cropping/search_deng/search_deng?img_url=${obj.path}&width=${obj.param.width}&height=${obj.param.height}`	
				})

			}
		}
	}
</script>

<style lang="scss">

</style>
